# Dreams have to come true after all
from sqlalchemy import ForeignKey

from comment import db


class BankCard(db.Model):
    __tablename__ = 't_bankcard'
    bankIndfoId = db.Column(db.Integer, primary_key=True, autoincrement=True)
    bankCardNum = db.Column(db.String(64), doc='银行卡号')
    openingBank = db.Column(db.String(64), doc='开户银行')
    cityId = db.Column(db.Integer, doc='城市id')

    userId = db.Column(db.BIGINT, ForeignKey('t_user.id'), doc='用户表主键')
    user = db.relationship('User', backref=db.backref('bankCards', lazy=True))
    bankId = db.Column(db.String(64), doc='银行支行')
    reservePhone = db.Column(db.String(64), doc='绑定手机号')
